import { useEffect, useState, useRef } from 'react';
import { Button, Card, Form, message, Popconfirm, Space } from 'antd';
import { ProForm, ProFormDatePicker } from '@ant-design/pro-components';
import {
  autoBaoCangApi,
  delChengJiaosApi,
  delWeiTuosApi,
  resetSyncDataApi,
  tongBuChengJiaoApi,
  tongBuPositionsApi,
  tongBuWeituoApi,
} from '@/api';
import { isSuccess } from '@/utils';
import { useRequest } from 'ahooks';
import dayjs from 'dayjs';
import SyncCangWei from './SyncCangWei';
import SyncWeituo from './SyncWeituo';
import HandleRuKu from './HandleRuKu';

export default function CustomTongBu() {
  useEffect(() => {}, []);

  // 自动爆仓
  const { loading: loadingAutoBaoCang, run: autoBaoCang } = useRequest(
    async () => {
      const res: any = (await autoBaoCangApi())?.data;
      console.log('res: 自动爆仓', res);
    },
    { manual: true },
  );

  return (
    <>
      {/* 解决入库失败的问题 */}
      <HandleRuKu />

      {/* 同步仓位 */}
      {/* <SyncCangWei /> <br /> */}

      {/* 同步历史委托,成交记录 */}
      {/* <SyncWeituo /> */}
      <br />

      {/* 自动爆仓 */}
      {/* <Card>
        <Button loading={loadingAutoBaoCang} onClick={autoBaoCang}>
          自动爆仓
        </Button>
      </Card> */}
    </>
  );
}
